<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<!-- Mirrored from themes.voodoo-pixel.com/skate/index-2.html by HTTrack Website Copier/3.x [XR&CO'2010], Fri, 16 Dec 2011 13:45:35 GMT -->
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="" />
<meta name="description" content="" />

<!--Title of your website-->
<title>Mercatino dei Libri Usati</title>

<!--CSS Styles-->
<link rel="stylesheet" type="text/css" href="css/login.css"/>
<link rel="stylesheet" type="text/css" href="css/typography.css"/>


<!--Java Script-->
<script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
<script type="text/javascript" src="js/jquery.validate.js"></script>
<script type="text/javascript" src="js/jquery.validation.messages_it.js"></script>
<script type="text/javascript" src="js/2.5.3-crypto-md5.js"></script>


</head>
<!--Body-->
<body> 
<div id="login_logo"> 
	<a href="index.php">
	<img src="images/mercatinologo.jpg" alt="SkateboardLife">
	</a>
</div>

<!--Wrapper-->
<div id="login_wrapper">

<!--Header-->
	<div id="login_header">
  
<!--Logo
	<div id="email_logo"> 
	<a href="index.php">
	<img src="images/mercatino logo.jpg"  alt="SkateboardLife" />
	</a>
	</div>
    -->
<!--Top Banner
	<div class="top-banner">
	<img src="images/demo/banners/top_banner.jpg" width="468" height="60" alt="Top-banner" />
	</div>
	-->
	
	</div>


<div id="login_content">

		<div id="login_box">
			<div id="login_box_title">Amministrazione</div>
			<div id="login_box_content">
				<div id="">
				<div id="login_error">
					<p>Login non riuscito</p>
				</div>
					<form id="login_form" onsubmit="return false;">
						<h6>Email</h6>
						<input type="text" id="email" name="email" class="email required"/>
						<h6>Password</h6>
						<input type="password" id="password" name="password"  class="required"/>
						<br>
						<input type="submit"/>
					</form>
				</div>
				<div id="">
					<!-- <a  href="#">Recupera password amministratore</a>  -->
				
				
				</div>
			</div>
		
		
		</div>
		
    
</div>
<script type="text/javascript">

var validation = $("#login_form").validate();


$("#login_form").submit( function(){
	$("#login_error").hide();
	if ( validation.form() ){
		loader = "<img class='loading' src='images/ajax-loader.gif' style='width: 14px; margin-left:5px;'>";
		$("#login_box_title").append(loader);
		var email = $("#email").val();
		var password = Crypto.MD5( $.trim($("#password").val()) );
		var dataSend = { email : email, password: password , request_type: "login"};
		$.ajax({
			  url: 'ajax.php',
			  data: dataSend,
			  type: "POST",
			  dataType: "json",
		  	 
			  success: function( data ) {
				  $(".loading").remove();
				  
			    if (data)
			    	$(location).attr('href',"admin.php");
			    else {
			    	 $("#login_content").effect("shake", { times:3 }, 50);
			    	 $("#login_error").show();
			    	 
			    }
			  }
			});
	}
});


</script>

</body>

</html>
